package pl.oczadly.jabberclient.message.view.manager;

import java.util.ArrayList;
import java.util.List;

import pl.oczadly.jabberclient.message.view.MessageView;

public class MessageViewManager {

	private static List<MessageView> messageViewList = new ArrayList<MessageView>();
	
	public static void addMessageView( MessageView view ) {
		messageViewList.add( view );
	}
	
	public static void removeMessageView( MessageView view ) {
		for( MessageView msgView : messageViewList ) {
			String id = msgView.getId();
			if( id.equals( view.getId() ) ) {
				messageViewList.remove( view );
				break;
			}
		}
	}
	
	public static boolean contains( String id ) {
		for( MessageView msgView : messageViewList ) {
			String tempId = msgView.getId();
			if( tempId.equals( id ) ) {
				return true;
			}
		}
		
		return false;
	}
}
